package is.bean.entity.region;

import is.bean.entity.NamedEntity;
import java.io.Serializable;

/**
 *
 * @author aspr0
 */
public class Region implements NamedEntity, Serializable
{
    private Integer id;
    private String name;
    private Integer parentId;

    @Override
    public Integer getId()
    {
        return id;
    }

    @Override
    public String getName()
    {
        return name;
    }

    public Integer getParentId()
    {
        return parentId;
    }

    public void setParentId(Integer parentId)
    {
        this.parentId = parentId;
    }

    public void setId(Integer id)
    {
        this.id = id;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    @Override
    public boolean equals(Object obj)
    {
        if (obj == null)
        {
            return false;
        }
        if (getClass() != obj.getClass())
        {
            return false;
        }
        final Region other = (Region) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id)))
        {
            return false;
        }
        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name))
        {
            return false;
        }
        if (this.parentId != other.parentId && (this.parentId == null || !this.parentId.equals(other.parentId)))
        {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode()
    {
        int hash = 7;
        hash = 61 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 61 * hash + (this.name != null ? this.name.hashCode() : 0);
        hash = 61 * hash + (this.parentId != null ? this.parentId.hashCode() : 0);
        return hash;
    }
}
